<template>
  <div>
    <p>数量总和:{{ $store.state.num }}</p>
    <button @click="add">增加</button>
    <button @click="jian">减少</button>
    <button @click="jijian">奇数加</button>
    <button @click="timeAdd">延迟两秒加</button>
  </div>
</template>

<script>
export default {
  name: "",
  methods: {
    add() {
      this.$store.dispatch("add");
    },
    jian() {
      this.$store.dispatch('jian')
    },
    jijian() {
      this.$store.dispatch('jijian')
    },
    timeAdd() {
      this.$store.dispatch('timeAdd')
    },
  },
};
</script>

<style scoped></style>
